package com.terran4j.kotlin.basic;

import java.util.Map;

public class IsNullable {

    private Map<String, Map<String, Object>> data = null;

    public Map<String, Map<String, Object>> getData() {
        return data;
    }

    public void setData(Map<String, Map<String, Object>> data) {
        this.data = data;
    }

    // 每步操作，都要判空处理，以避免空指针异常。
    public Object getValue(String key1, String key2) {
        if (data == null) {
            return null;
        }
        Map<String, Object> map = data.get(key1);
        if (map == null) {
            return null;
        }
        return map.get(key2);
    }


}
